<?php
namespace app\api\controller\member;
use app\common\controller\BaseController;
use app\common\service\member\MemberMessageService;
use app\common\validate\member\MemberMessageValidate;
use hg\apidoc\annotation as Apidoc;
/**
 * @Apidoc\Title("消息通知")
 * @Apidoc\Group("member")
 * @Apidoc\Sort("250")
 */
class MemberMessage extends BaseController
{
    /**
    * @Apidoc\Title("消息通知列表")
    * @Apidoc\Query(ref="pagingQuery")
    * @Apidoc\Query(ref="sortQuery")
    * @Apidoc\Query(ref="searchQuery")
    * @Apidoc\Query(ref="dateQuery")
    * @Apidoc\Returned(ref="expsReturn")
    * @Apidoc\Returned(ref="pagingReturn")
    * @Apidoc\Returned("list", type="array", desc="消息通知列表", children={
    *   @Apidoc\Returned(ref="app\common\model\member\MemberMessageModel", field="id,title,content,is_disable,create_time,update_time,remark,member_id,data_id,code")
    * })
    */
    public function list()
    {
        $where = $this->where(where_delete());
        $where[] = ['member_id','=',member_id(true)];
        $where[] = ['is_disable','=',0];
        $data = MemberMessageService::list($where, $this->page(), $this->limit(), $this->order(),'id,title,content,create_time');
        return success($data);
    }
}
